﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Master.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="UI.Admin.Log.Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="/Admin/assets/css/jquery-ui-1.10.3.full.min.css" />
    <script src="JsFunction.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="row">
	    <div class="col-xs-12">
           
		    <h3 class="header smaller lighter orange">日志列表&nbsp;&nbsp;&nbsp;&nbsp;<i class="icon-hand-right"></i>
                <small>批量删除&nbsp;
                	<input id="spinner" name="value" type="text" class=" input-mini" disabled="disabled"/>
                    &nbsp;天前记录 &nbsp; &nbsp;
                    
					<button class="btn btn-warning btn-xs" title="批量删除" data-rel="tooltip" onclick="summit_deletes_log()">
						<i class="icon-trash icon-2x"></i>
					</button>
		    </small></h3>
		    <div class="table-header badge-warning">
			    通过日志可以对系统所有事务进行跟踪记录，记录最多可以保存30天。
		    </div>

		    <div class="table-responsive">
			    <table id="sample-table-2" class="table table-striped table-bordered table-hover">
				    <thead>
					    <tr>
						   
						   
						    <th>操作用户</th>
						    <th>用户IP</th>
                             <th>内容</th>				
						    <th>时间</th>
						    <th></th>
					    </tr>
				    </thead>

				    <tbody>

                        <%if (LogList != null)
                          { %>
                        <%for (int i = 0; i < LogList.Count; i++)
                          { %>
					    <tr>
                           
						    <td><%=LogList[i].UserName%></td>
						    <td><span class="label label-sm label-warning"><%=LogList[i].UserIP%></span></td>
						    <td><%=LogList[i].Action%></td>
						    <td><%=LogList[i].Time%></td>
						    <td>
							    <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
								    <a class="red" href="javascript:void(0)"  <%=Utility.Tool.TimeSpanLog(LogList[i].Time)<1?"data-rel=\"popover\" data-placement=\"left\" data-original-title=\"<i class='icon-bolt red'></i> 温馨提示\" data-content=\"日志保存时间小于一天是不可以删除的。\"":"onclick='summit_delete_log("+LogList[i].ID+")'" %>>
									    <i class="icon-trash bigger-130"></i>
								    </a>
							    </div>
						    </td>
					    </tr>
	                        <%} %>
		                <%} %>

				    </tbody>
			    </table>
		    </div>
	    </div>
    </div>

    <div id="dialog-confirm" class="hide">	
		<div class="alert alert-info bigger-110" id="delete_tips">
			删除操作执行后不可恢复
		</div>

		<div class="space-6"></div>

		<p class="bigger-110 bolder center grey">
			<i class="icon-hand-right blue bigger-120"></i>
			Are you sure?
		</p>
	</div><!-- #dialog-confirm -->
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <script src="/Admin/assets/js/jquery-ui-1.10.3.full.min.js"></script>
	<script src="/Admin/assets/js/jquery.ui.touch-punch.min.js"></script>
    <script src="/Admin/assets/js/jquery.dataTables.min.js" charset="GB2312"></script>
	<script src="/Admin/assets/js/jquery.dataTables.bootstrap.js" charset="GB2312"></script>
      <script type="text/javascript">
          jQuery(function ($) {
              var oTable1 = $('#sample-table-2').dataTable({
                  "aoColumns": [
                     null, null, null, null,
                    { "bSortable": false }
                  ]
              });
              $('table th input:checkbox').on('click', function () {
                  var that = this;
                  $(this).closest('table').find('tr > td:first-child input:checkbox')
                  .each(function () {
                      this.checked = that.checked;
                      $(this).closest('tr').toggleClass('selected');
                  });

              });


              $('[data-rel="tooltip"]').tooltip({ placement: tooltip_placement });
              function tooltip_placement(context, source) {
                  var $source = $(source);
                  var $parent = $source.closest('table')
                  var off1 = $parent.offset();
                  var w1 = $parent.width();

                  var off2 = $source.offset();
                  var w2 = $source.width();

                  if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) return 'right';
                  return 'left';
              }
          })

          $.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, {
              _title: function (title) {
                  var $title = this.options.title || '&nbsp;'
                  if (("title_html" in this.options) && this.options.title_html == true)
                      title.html($title);
                  else title.text($title);
              }
          }));


          //spinner
          var spinner = $("#spinner").spinner({
              value: 0,
              min: 1,
              max: 30,
              step: 1,
              create: function (event, ui) {
                  //add custom classes and icons
                  $(this)
                  .next().addClass('btn btn-success').html('<i class="icon-plus"></i>')
                  .next().addClass('btn btn-danger').html('<i class="icon-minus"></i>')

                  //larger buttons on touch devices
                  if (ace.click_event == "tap") $(this).closest('.ui-spinner').addClass('ui-spinner-touch');
              }
          });
          $('[data-rel=popover]').popover({ html: true });
    </script>
</asp:Content>
